package com.tlx.spring.boot.blog.elasticsearch.entity.es;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.io.Serializable;

/**
 *
 */
@Document(indexName = "blog",type = "blog") // 文档
public class EsBlog implements Serializable {
    private static final long serialVersionUID = -9021235212448564684L;
    @Id // 主键
    private String id;
    private String title;
    private String summary;
    private String content;

    public EsBlog(String id,String title, String summary, String content) {
        this.id = id;
        this.title = title;
        this.summary = summary;
        this.content = content;
    }

    @Override
    public String toString() {
        return String.format("Blog[id=%s,title=%s,summary=%s,content=%s]",id,title,summary,content);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    EsBlog() { // jpa规范，防止直接使用
    }
}
